/**
 * @file ZUtility.h
 * @brief utility for ZSuffixTree
 * @author babear.wangz
 * @date 2011-04-02
 */

#ifndef ZST_Utility_H
#define ZST_Utility_H

#include <assert.h>
#include <stdlib.h>
#include <new>

#if defined(__linux)
#include <stdint.h>
#elif defined(WIN32) || defined(_WIN32)
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int int32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#endif

#ifdef DEBUG
#define ASSERT(expr) assert(expr)
#else
#define ASSERT(expr)
#endif

#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
    TypeName(const TypeName&);             \
    void operator = (const TypeName&)

#define CRASH() do {                                       \
    *reinterpret_cast<int*>((unsigned int)0xbbadbeef) = 0; \
    ((void(*)())0)();                                      \
} while (false)

#endif

